﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public DataSet QueryICC_MBST(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    break;
                case 2:
                    or1.CommandText = "SELECT 1 AS BAID,MBMANDANT AS MANDANT"
                    + ",MBMAT AS ART,MBVAR AS VAR,MBLO AS LO,MBLB AS LB,MBLP AS LP,MBVPEINH AS LOT,MBME*0.001 AS QTY,0 AS QTYLOCKED,MBME*0.001 AS QTYFREE"
                    + " FROM MBST M  "
                    + " WHERE MBMANDANT=:MBMANDANT AND MBMAT=:MBMAT AND MBVAR=:MBVAR";
                    or1.Parameters.Add("MBMANDANT", OracleType.NVarChar).Value = dwData["MBMANDANT"].ToString();
                    or1.Parameters.Add("MBMAT", OracleType.NVarChar).Value = dwData["MBMAT"].ToString();
                    or1.Parameters.Add("MBVAR", OracleType.NVarChar).Value = dwData["MBVAR"].ToString();
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "ICC_MBST";
            Return = Result;
            return Return;
        }
    }
}
